--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Commit cef44c218957c8c9c3fd1b4ba030c73442bc8e94
Parents : 7b7903b
Author : Mark Qvist <mark@unsigned.io>
Date : 2022-10-13T22:12:39+02:00
Improved dialogs and buttons
Changes
4 files changed, 29 insertions(+), 29 deletions(-)
Diff
diff --git a/sbapp/main.py b/sbapp/main.py
index ff882da9..5dbc0ae0 100644
--- a/sbapp/main.py
+++ b/sbapp/main.py
@@ -479,7 +479,7 @@ class SidebandApp(MDApp):
def announce_now_action(self, sender=None):
self.sideband.lxmf_announce()
- yes_button = MDRectangleFlatButton(text="OK",font_size=sp(18))
+ yes_button = MDRectangleFlatButton(text="OK",font_size=dp(18))
dialog = MDDialog(
title="Announce Sent",
@@ -563,12 +563,12 @@ class SidebandApp(MDApp):
if self.root.ids.screen_manager.current == "messages_screen":
if self.outbound_mode_propagation and self.sideband.message_router.get_outbound_propagation_node() == None:
self.messages_view.send_error_dialog = MDDialog(
- text="Error: Propagated delivery was requested, but no active LXMF propagation nodes were found. Cannot send message. Wait for a Propagation Node to announce on the network, or manually specify one in the settings.",
+ title="Error",
+ text="Propagated delivery was requested, but no active LXMF propagation nodes were found. Cannot send message.\n\nWait for a Propagation Node to announce on the network, or manually specify one in the settings.",
buttons=[
- MDFlatButton(
+ MDRectangleFlatButton(
text="OK",
- theme_text_color="Custom",
- text_color=self.theme_cls.primary_color,
+ font_size=dp(18),
on_release=self.messages_view.close_send_error_dialog
)
],
@@ -586,12 +586,12 @@ class SidebandApp(MDApp):
self.jobs(0)
else:
self.messages_view.send_error_dialog = MDDialog(
- text="Error: Could not send the message",
+ title="Error",
+ text="Could not send the message",
buttons=[
- MDFlatButton(
+ MDRectangleFlatButton(
text="OK",
- theme_text_color="Custom",
- text_color=self.theme_cls.primary_color,
+ font_size=dp(18),
on_release=self.messages_view.close_send_error_dialog
)
],
@@ -723,8 +723,8 @@ class SidebandApp(MDApp):
self.sideband.setpersistent("lxmf.syncretrying", False)
self.sideband.request_lxmf_sync(limit=sl)
- close_button = MDRectangleFlatButton(text="Close",font_size=sp(18))
- stop_button = MDRectangleFlatButton(text="Stop",font_size=sp(18), theme_text_color="Custom", line_color=self.color_reject, text_color=self.color_reject)
+ close_button = MDRectangleFlatButton(text="Close",font_size=dp(18))
+ stop_button = MDRectangleFlatButton(text="Stop",font_size=dp(18), theme_text_color="Custom", line_color=self.color_reject, text_color=self.color_reject)
dialog_content = MsgSync()
dialog = MDDialog(
title="LXMF Sync via "+RNS.prettyhexrep(self.sideband.message_router.get_outbound_propagation_node()),
@@ -763,8 +763,8 @@ class SidebandApp(MDApp):
font_size=dp(20),
)
- cancel_button = MDRectangleFlatButton(text="Cancel",font_size=sp(18))
- create_button = MDRectangleFlatButton(text="Create",font_size=sp(18), theme_text_color="Custom", line_color=self.color_accept, text_color=self.color_accept)
+ cancel_button = MDRectangleFlatButton(text="Cancel",font_size=dp(18))
+ create_button = MDRectangleFlatButton(text="Create",font_size=dp(18), theme_text_color="Custom", line_color=self.color_accept, text_color=self.color_accept)
dialog_content = NewConv()
dialog = MDDialog(
@@ -1338,7 +1338,7 @@ class SidebandApp(MDApp):
try:
mote = Clipboard.paste()
except Exception as e:
- yes_button = MDRectangleFlatButton(text="OK",font_size=sp(18))
+ yes_button = MDRectangleFlatButton(text="OK",font_size=dp(18))
dialog = MDDialog(
title="Import Failed",
text="Could not read data from your clipboard, please check your system permissions.",
@@ -1385,7 +1385,7 @@ class SidebandApp(MDApp):
if self.hardware_rnode_validate():
self.hardware_rnode_save()
- yes_button = MDRectangleFlatButton(text="OK",font_size=sp(18))
+ yes_button = MDRectangleFlatButton(text="OK",font_size=dp(18))
dialog = MDDialog(
title="Configuration Imported",
text="The config mote was imported and saved as your active configuration.",
@@ -1400,7 +1400,7 @@ class SidebandApp(MDApp):
raise ValueError("Invalid mote")
except Exception as e:
- yes_button = MDRectangleFlatButton(text="OK",font_size=sp(18))
+ yes_button = MDRectangleFlatButton(text="OK",font_size=dp(18))
dialog = MDDialog(
title="Import Failed",
text="The read data did not contain a valid config mote. If any data was decoded, you may try to correct it by editing the relevant fields. The reported error was:\n\n"+str(e),
@@ -1431,7 +1431,7 @@ class SidebandApp(MDApp):
if mote != None:
Clipboard.copy(mote)
- yes_button = MDRectangleFlatButton(text="OK",font_size=sp(18))
+ yes_button = MDRectangleFlatButton(text="OK",font_size=dp(18))
dialog = MDDialog(
title="Configuration Exported",
text="The config mote was created and copied to your clipboard.",
@@ -1443,7 +1443,7 @@ class SidebandApp(MDApp):
yes_button.bind(on_release=dl_yes)
dialog.open()
else:
- yes_button = MDRectangleFlatButton(text="OK",font_size=sp(18))
+ yes_button = MDRectangleFlatButton(text="OK",font_size=dp(18))
dialog = MDDialog(
title="Export Failed",
text="The config mote could not be created, please check your settings.",
diff --git a/sbapp/ui/announces.py b/sbapp/ui/announces.py
index b7622a53..b055940b 100644
--- a/sbapp/ui/announces.py
+++ b/sbapp/ui/announces.py
@@ -85,7 +85,7 @@ class Announces():
def gen_info(ts, dest, name, dtype):
def x(sender):
- yes_button = MDRectangleFlatButton(text="OK",font_size=sp(18))
+ yes_button = MDRectangleFlatButton(text="OK",font_size=dp(18))
if dtype == "lxmf.delivery":
ad_text = "[size=22dp]LXMF Peer[/size]\n\nReceived: "+ts+"\nAnnounced Name: "+name+"\nAddress: "+RNS.prettyhexrep(dest)
@@ -127,8 +127,8 @@ class Announces():
def gen_del(dest, item):
def x():
- yes_button = MDRectangleFlatButton(text="Yes",font_size=sp(18), theme_text_color="Custom", line_color=self.app.color_reject, text_color=self.app.color_reject)
- no_button = MDRectangleFlatButton(text="No",font_size=sp(18))
+ yes_button = MDRectangleFlatButton(text="Yes",font_size=dp(18), theme_text_color="Custom", line_color=self.app.color_reject, text_color=self.app.color_reject)
+ no_button = MDRectangleFlatButton(text="No",font_size=dp(18))
dialog = MDDialog(
title="Delete announce?",
buttons=[ yes_button, no_button ],
diff --git a/sbapp/ui/conversations.py b/sbapp/ui/conversations.py
index 27bf00bf..56f48b4b 100644
--- a/sbapp/ui/conversations.py
+++ b/sbapp/ui/conversations.py
@@ -95,8 +95,8 @@ class Conversations():
disp_name = self.app.sideband.raw_display_name(dest)
is_trusted = self.app.sideband.is_trusted(dest)
- yes_button = MDRectangleFlatButton(text="Save",font_size=sp(18), theme_text_color="Custom", line_color=self.app.color_accept, text_color=self.app.color_accept)
- no_button = MDRectangleFlatButton(text="Cancel",font_size=sp(18))
+ yes_button = MDRectangleFlatButton(text="Save",font_size=dp(18), theme_text_color="Custom", line_color=self.app.color_accept, text_color=self.app.color_accept)
+ no_button = MDRectangleFlatButton(text="Cancel",font_size=dp(18))
dialog_content = ConvSettings(disp_name=disp_name, context_dest=RNS.hexrep(dest, delimit=False), trusted=is_trusted)
dialog = MDDialog(
title="Edit Conversation",
@@ -145,8 +145,8 @@ class Conversations():
def gen_clear(dest, item):
def x():
dest = self.conversation_dropdown.context_dest
- yes_button = MDRectangleFlatButton(text="Yes",font_size=sp(18), theme_text_color="Custom", line_color=self.app.color_reject, text_color=self.app.color_reject)
- no_button = MDRectangleFlatButton(text="No",font_size=sp(18))
+ yes_button = MDRectangleFlatButton(text="Yes",font_size=dp(18), theme_text_color="Custom", line_color=self.app.color_reject, text_color=self.app.color_reject)
+ no_button = MDRectangleFlatButton(text="No",font_size=dp(18))
dialog = MDDialog(
title="Clear all messages in conversation?",
@@ -167,8 +167,8 @@ class Conversations():
def gen_del(dest, item):
def x():
- yes_button = MDRectangleFlatButton(text="Yes",font_size=sp(18), theme_text_color="Custom", line_color=self.app.color_reject, text_color=self.app.color_reject)
- no_button = MDRectangleFlatButton(text="No",font_size=sp(18))
+ yes_button = MDRectangleFlatButton(text="Yes",font_size=dp(18), theme_text_color="Custom", line_color=self.app.color_reject, text_color=self.app.color_reject)
+ no_button = MDRectangleFlatButton(text="No",font_size=dp(18))
dialog = MDDialog(
title="Delete conversation?",
buttons=[ yes_button, no_button ],
diff --git a/sbapp/ui/messages.py b/sbapp/ui/messages.py
index 5c2b4a36..16db440b 100644
--- a/sbapp/ui/messages.py
+++ b/sbapp/ui/messages.py
@@ -162,8 +162,8 @@ class Messages():
def gen_del(mhash, item):
def x():
- yes_button = MDRectangleFlatButton(text="Yes",font_size=sp(18), theme_text_color="Custom", line_color=self.app.color_reject, text_color=self.app.color_reject)
- no_button = MDRectangleFlatButton(text="No",font_size=sp(18))
+ yes_button = MDRectangleFlatButton(text="Yes",font_size=dp(18), theme_text_color="Custom", line_color=self.app.color_reject, text_color=self.app.color_reject)
+ no_button = MDRectangleFlatButton(text="No",font_size=dp(18))
dialog = MDDialog(
title="Delete message?",
buttons=[ yes_button, no_button ],
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────